package com.hospital.common.core.utils;

import com.hospital.common.core.constants.InsuranceDeptEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@Data
@Component
public class PayWayVsHis {
    public enum DbValueEnum {
        wx("微信"), zfb("支付宝"), yhk("银行卡"), dzyb("医保统筹"), yjz("预交金"), ysf("云闪付"), yibaoqud("移动医保");
        private String value;

        DbValueEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    public static String getPayWayCode(String keyValue) {
        Map<String, String> dataBaseMap = new HashMap<>();
        dataBaseMap.put("WNATIVE", DbValueEnum.wx.getValue());
        dataBaseMap.put("ANATIVE", DbValueEnum.zfb.getValue());
        dataBaseMap.put("UQR", DbValueEnum.yhk.getValue());
        dataBaseMap.put("EMICATIVE", DbValueEnum.dzyb.getValue());
        dataBaseMap.put("PREATIVE", DbValueEnum.yjz.getValue());
        dataBaseMap.put("UP", DbValueEnum.ysf.getValue());
        dataBaseMap.put("MOVEINSUR", DbValueEnum.yibaoqud.getValue());
        return dataBaseMap.get(keyValue);
    }

    public static String getMoneyTypeCode(String keyValue) {
        Map<String, String> dataBaseMap = new HashMap<>();
        dataBaseMap.put("ALI", InsuranceDeptEnum.DEPOSIT_TYPE_ALI.getMessage());
        dataBaseMap.put("BANK", InsuranceDeptEnum.DEPOSIT_TYPE_BANK.getMessage());
        dataBaseMap.put("WX", InsuranceDeptEnum.DEPOSIT_TYPE_WX.getMessage());
        dataBaseMap.put("UP", InsuranceDeptEnum.DEPOSIT_TYPE_UP.getMessage());
        return dataBaseMap.get(keyValue);
    }
}
